{% unless placement %}
  {% if id %}
    {% assign placement = ads.placements[id] %}
  {% elsif name %}
    {% assign placement = ads.placements[name] %}
  {% endif %}
{% endunless %}

{% if placement %}
<div class="ad" data-url="{{ placement.random_url | h }}"></div>
{% endif %}